var user_comment_set_ops={
	init:function(){
		this.eventBind();
		this.score=0;
	},
	eventBind:function(){
		var that=this;
		$('#star').raty({
            half: true,
            click:function( score, evt ){
                that.score = score;
            }
        });
		//点击获取手机验证码事件
		$(".save").click(function(){
			var common=$(".addr_textarea").val();
			var score=that.score;
			var book_id=$("input[name=book_id]").val();
			var pay_order_id=$("input[name=pay_order_id]").val();
			$.ajax({
				url:common_ops.buildMUrl('/user/comment_set'),
				type:"POST",
				dataType:"json",
				data:{
					score:score,
					comment:common,
					book_id:book_id,
					pay_order_id:pay_order_id,
				},
				success:function(res){
					
					callback=null;
					if(res.code==200){
						callback=function(){
							window.location.href=common_ops.buildMUrl('/user/comment');
						}
					}
					common_ops.alert(res.msg,callback);
				},
			});
		});
		
	},
};
$(document).ready(function(){
	user_comment_set_ops.init();
});